-
Notifications
You must be signed in to change notification settings - Fork 266
Fix psalm errors #1209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix psalm errors #1209
Conversation
<LessSpecificReturnStatement> | ||
<code><![CDATA[(object) $this->getArrayCopy()]]></code> | ||
</LessSpecificReturnStatement> | ||
<MixedAssignment> | ||
<code>$this[$key]</code> | ||
<code>$value</code> | ||
</MixedAssignment> | ||
<MoreSpecificReturnType> | ||
<code>stdClass</code> | ||
</MoreSpecificReturnType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LessSpecificReturnStatement
and MoreSpecificReturnType
are due to vimeo/psalm#8187. In essence, Psalm takes the return value of (object) []
to be object
, even though it is stdClass
.
<MixedArgument> | ||
<code><![CDATA[$options['codec'] ?? null]]></code> | ||
</MixedArgument> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this errors in that one specific file - it works in all other files where we have the same checks on the codec option and then use it in a typed context 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't reproduce.
https://psalm.dev/r/609a35bce9
064bbed
to
2651e38
Compare
2651e38
to
6ac6209
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should set a stronger constraint on the psalm version, since there is no compose.lock
.
Yes, perhaps paired with dependabot updating the version constraint range when an update was released. I'll give it some thought. |
* v1.17: Fix psalm errors (#1209)
This fixes a couple of errors that appeared due to a psalm update which updated the PHPC method signatures.